package com.arpa.wms.mapper;

import com.arpa.wms.domain.dto.WarehouseSpaceDTO;
import com.arpa.wms.domain.entity.WarehouseSpace;
import com.arpa.wms.domain.vo.WarehouseSpaceVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 库区 Mapper 接口
 * </p>
 *
 * @author LEO
 * @since 2020-08-03
 */
public interface WarehouseSpaceMapper extends BaseMapper<WarehouseSpace> {

    /**
     * 查询列表
     * @param warehouseSpaceDTO
     * @return
     */
    List<WarehouseSpaceVO> queryList(WarehouseSpaceDTO warehouseSpaceDTO);

    /**
     * 查询合计,包含总数
     * @param warehouseSpaceDTO
     * @return
     */
    WarehouseSpaceVO queryListSum(WarehouseSpaceDTO warehouseSpaceDTO);

    /**
     * 更新库区状态
     * @param codes
     * @param status
     * @return
     */
    int changeStatus(@Param("codes")String codes,@Param("status")String status,@Param("deleteFlag")String deleteFlag);
 /**
  *  @author: Allen chen
  *  @Date: 2020/10/15 15:09
  *  @Description: 根据仓库codes 批量更新库区状态
  */
    int changeStatusByWarehouseCodes(@Param("list")List<String> list,@Param("status")String status,@Param("deleteFlag")String deleteFlag,@Param("groupCode")String groupCode);


    /**
     * 查询0库存的库位code
     * @param codes
     * @return
     */
    List<String> emptyWarehouseSpace(@Param("codes") String codes,@Param("groupCode")String groupCode);
    /**
     *  @author: Allen chen
     *  @Date: 2020/10/10 9:15
     *  @Description: 根据code批量查询
     */
    List<WarehouseSpaceVO> getByCodes(@Param("list") List<String> list,@Param("groupCode")String groupCode);

    /**
     * 库位导入时使用
     * @return
     */
    List<WarehouseSpaceVO> findAllInfo(@Param("groupCode")String groupCode);

    /**
     * 根据条件获取库区 所属机构
     *  仓库标识：warehouseCode
     *  状态：status
     *  临时库区：tempSpace
     * @return
     */
    List<WarehouseSpaceVO> findAllByWarehouseCode(Map<String,Object> map);
}
